package com.dwcode.macro.controller;


import com.dwcode.macro.entity.Emp;
import com.dwcode.macro.dto.Pagination;
import com.dwcode.macro.service.EmpService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/emp")
public class EmpController {

    @Autowired
    private EmpService empService;
    /**
     * 分页获取员工信息
     * @param page 分页数据
     * @return
     */
    @GetMapping("/getEmps")
    @ResponseBody
    @ApiOperation("获取分页员工列表")
    public Pagination<Emp> getEmps(Pagination page) {

        return this.empService.getEmps(page);
    }

}
